#include "DLinkList.h"

void Test1()
{
	ListNode* phead = ListCreate();
	ListPushBack(phead, 1);
	ListPushBack(phead, 2);
	ListPushBack(phead, 3);
	ListPrint(phead);

	ListPopBack(phead);
	ListPrint(phead);

	ListPushFront(phead, 1);
	ListPushFront(phead, 0);
	ListPrint(phead);
	
	ListDestory(&phead);

}

void Test2()
{
	ListNode* phead = ListCreate();
	ListPushBack(phead, 1);
	ListPushBack(phead, 2);
	ListPushBack(phead, 3);
	ListPrint(phead);

	ListInsert(ListFind(phead, 3), 4);
	ListInsert(ListFind(phead, 3), 5);
	ListInsert(ListFind(phead, 3), 6);

	ListErase(ListFind(phead, 3));
	ListPrint(phead);
}

int main()
{
	Test1();
	Test2();
	return 0;
}